<head>
<script type="text/javascript">

            function anyCheck()
            {
				var total = 0;
        		var max = document.querySelectorAll('[type=checkbox]');
        		for (var idx = 0; idx < max.length; idx++) {
            	if (max[idx].checked) {
                	total++;
            		}
        		}
        		alert("You selected " + total + " Quizes");
            }
			
			function toggle()
			{
				var e=document.getElementById("topicSelect");
				var two=e.options[e.selectedIndex].value;
				if (two == "Computer Science")
				{
					document.getElementById("computerscience").style.display = "block";
					document.getElementById("physics").style.display = "none";
					document.getElementById("history").style.display = "none";
					document.getElementById("biology").style.display = "none";
					document.getElementById("submission").style.display = "block";
				}
				else if(two == "Physics")
				{
					document.getElementById("computerscience").style.display = "none";
					document.getElementById("physics").style.display = "block";
					document.getElementById("history").style.display = "none";
					document.getElementById("biology").style.display = "none";
					document.getElementById("submission").style.display = "block";
				}
				else if(two == "History")
				{
					document.getElementById("computerscience").style.display = "none";
					document.getElementById("physics").style.display = "none";
					document.getElementById("history").style.display = "block";
					document.getElementById("biology").style.display = "none";
					document.getElementById("submission").style.display = "block";
				}
				else if(two == "Biology")
				{
					document.getElementById("computerscience").style.display = "none";
					document.getElementById("physics").style.display = "none";
					document.getElementById("history").style.display = "none";
					document.getElementById("biology").style.display = "block";
					document.getElementById("submission").style.display = "block";
				}
				
			}
			
        </script>
</head>
<div id="b"><p><a href="/QSS/view/UserHome.jsp"><font color=#4682B4>Home</font></a></p></div>
<%-- <%System.out.println(request.getSession().getAttribute("userID")); --%>
<!--  %> -->
<div id="e">
<p><a href="/QSS/view/Logout.jsp"><font color=#4682B4>Logout</font></a></p></div>
<body>
<br>
<br>
<form  method="post" action="MarketPlace" name="selection" id="selection">
<h4>Quiz Topic Selection</h4> 
			Choose Topic:
			<select id="topicSelect" name="topicSelect" >
			<option value="Computer Science">Computer Science </option>
			<option value="Biology">Biology </option>
			<option value="History">History </option>
			<option value="Physics">Physics </option>
			</select>
			<input type="button" name="submit" value="Submit" onclick="toggle();">
<br>
<br>

<div id="computerscience" hidden="true">
Select sub topic:<br>
<input type="checkbox" name="Computer Science" value="datastructures"/>datastructures<br>
<input type="checkbox" name="Computer Science" value="Java"/>Java<br>
<input type="checkbox" name="Computer Science"  value="Programming"/>Programming<br>
</div>
<div id="biology" hidden="true">
<input type="checkbox" name="Biology" value="Physiology"/>Physiology<br>
<input type="checkbox" name="Biology" value="Cell Biology"/>Cell Biology<br>
<input type="checkbox" name="Biology" value="Neuro Biology"/>Neuro Biology<br>
<input type="checkbox" name="Biology" value="genetics"/>genetics<br>
<input type="checkbox" name="Biology" value="BioChemistry"/>BioChemistry<br>
<input type="checkbox" name="Biology" value="Human Diseases"/>Human Diseases<br>
<input type="checkbox" name="Biology" value="Nutrition"/>Nutrition<br>
<input type="checkbox" name="Biology" value="Perception"/>Perception<br>
<input type="checkbox" name="Biology" value="Neuro Anatomy"/>Neuro Anatomy<br>
</div>
<div  id="history" hidden="true">
<input type="checkbox" name="History" value="American History"/>American History<br>
<input type="checkbox" name="History" value="World history"/>World history<br>
</div>
<div id="physics" hidden="true">
<input type="checkbox" name="Physics" value="Modern Physics "/>Modern Physics<br>
</div>
<br/>
<div id="submission">
<input type="submit" name="submit" value="Submit" onclick="anyCheck();" >
</form>
</div>
<br/>
<br/>

</body>